﻿using Core.Domain.Customers;
using System.Data.Entity.ModelConfiguration;

namespace Data.Mapping.Customers
{
    public partial class CustomerMap : EntityTypeConfiguration<Customer>
    {
        public CustomerMap()
        {
            this.ToTable("Customer");
            this.HasKey(c => c.Id);
            this.Property(u => u.Username).HasMaxLength(100);
            this.Property(u => u.Email).HasMaxLength(200);
            this.Property(u => u.Phone).HasMaxLength(200);

            this.Ignore(u => u.RegisterEnum);

            this.HasOptional<CustomerRole>(c => c.CustomerRole);
        }
    }
}
